package com.springboot.base.controller;


import cc.mrbird.febs.common.utils.FebsUtil;
import cc.mrbird.febs.system.domain.User;
import com.springboot.base.service.ISysUserService;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author 福小林
 * @since 2019-09-11
 */
@RestController
@RequestMapping("/sys-user")
public class SysUserController {



    @Autowired
    ISysUserService iSysUserService;
    @Value("${server.port}")
    private String port;


    @GetMapping("/hello")
    @RequiresPermissions("user:online")
    public String hi(@RequestParam(value = "name", defaultValue = "nacos", required = false) String name) {
        User currentUser = FebsUtil.getCurrentUser();
        String AAAA="WW";
        System.out.println(currentUser);
        return "hello" + name;
    }
    @GetMapping("/abc")
    @RequiresPermissions("user:abc")
    public String abc(HttpServletRequest request) {
        String why = request.getParameter("why");
        System.out.println(why);
        return " 服务的端口号是 " + port;
    }
  

}
